package com.yvtian.admin.controller;

import com.yvtian.admin.service.YTDataService;
import com.yvtian.entity.Result;
import com.yvtian.entity.StatusCode;
import com.yvtian.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/data/screen")
public class YTDataController {

    @Autowired
    private YTDataService ytDataService;

    @GetMapping("time")
    public Result getSysTime() {
        return new Result(true, "成功", StatusCode.OK, DateUtils.format(DateUtils.FormatType.type2, new Date()));
    }

    /**
     * 获取当前产线的基础数据
     * @return Result
     */
    @GetMapping("/currEqInfo")
    public Result currEqInfo(){

        return new Result(true, "成功", StatusCode.OK,ytDataService.getBottomData());
    }

    @GetMapping("/getBottomData")
    public Result getBottomData(){

        return new Result(true, "成功", StatusCode.OK,ytDataService.getBottomData());
    }
}
